import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)


const routes = [{
    path: '/',
    name: 'Home',
    component: () =>
      import('@/pages/Home/Home')
  },
  {
    path: '/My',
    name: 'My',
    component: () =>
      import('@/pages/My/Index')
  },
  {
    path: '/He',
    name: 'He',
    component: () =>
      import('@/pages/He/Index')
  },
  {
    path: '/Info',
    name: 'Info',
    component: () =>
      import('@/pages/Info/Index')
  },
  {
    path: '/creatVideo',
    name: 'creatVideo',
    component: () =>
      import('@/pages/creatVideo/Index')
  },
  {
    path: '/login',
    name: 'login',
    component: () =>
      import('@/pages/login/index')
  },
]

var routermode = 'history'
if (process.env.NODE_ENV === 'production') {
  routermode = 'hash'
}

const router = new VueRouter({
  // mode: 'history',
  //上线换成 hash
  mode: routermode,
  base: process.env.BASE_URL,
  routes
})

export default router